// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
const db = cloud.database({
  env: 'gtss-2b1812'
})
exports.main = async(event, context) => {
  try {
    await db.collection('Config').where({
      dept: event.dept
    }).update({
      data: {
        stuKtmax: event.stuKtmax,
        teaStumax: event.teaStumax
      }
    })
    return {
      result: 1
    }
  } catch (e) {
    return {
      result: 1
    }
  }
}